安装oracle时./runInstaller报错:

Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.

具体错误信息如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[oracle@glxybd database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 1008384 MB Passed
Checking swap space: must be greater than 150 MB. Actual 16128 MB Passed
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<

Some requirement checks failed. You must fulfill these requirements before

continuing with the installation,

Continue? (y/n) [n] y

>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-06_11-13-35PM. Please wait ...[oracle@glxybd database]$ Exception in thread "main" java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at java.awt.Toolkit$2.run(Toolkit.java:821)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
at com.jgoodies.looks.LookUtils.isLowResolution(Unknown Source)
at com.jgoodies.looks.LookUtils.<clinit>(Unknown Source)
at com.jgoodies.looks.plastic.PlasticLookAndFeel.<clinit>(PlasticLookAndFeel.java:122)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1783)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:480)
at oracle.install.commons.util.Application.startup(Application.java:758)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265)
at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114)
at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:132)

原因是oracle客户端ssh认证出现问题 。

当你设置的是export DISPLAY=:10.0时,执行echo $DISPLAY查看DISPLAY是正常的
在这里插入图片描述
但运行xterm时报错,这才是导致上面异常的原因
未识别

解决方法

root角色执行echo $DISPLAY,发现为 xxx:10.0
1
2
[root@glxybd ~]# echo $DISPLAY
localhost:10.0
xauth list找到 :10 对应的那行并复制内容
1
2
3
[root@glxybd ~]#  xauth list
glxybd.ctbu.edu.cn/unix:7 MIT-MAGIC-COOKIE-1 08047574ce998c3b95d87fea02ea0a9b
glxybd.ctbu.edu.cn/unix:10 MIT-MAGIC-COOKIE-1 cb15548cf27a3b2dbfe7c50b3d1b79b3
切换到oracle角色su - oracle,然后执行以下语句添加xauth到oracle认证信息中

注意:向oracle中添加时必须与root角色复制时处在同一次连接操作,不然重新连接服务器时xauth list查询时可能会变

1
xauth add glxybd.ctbu.edu.cn/unix:10  MIT-MAGIC-COOKIE-1  cb15548cf27a3b2dbfe7c50b3d1b79b3
执行xauth list查看oracle的xauth 信息是否成功添加
1
2
[oracle@glxybd root]$ xauth list
glxybd.ctbu.edu.cn/unix:10 MIT-MAGIC-COOKIE-1 cb15548cf27a3b2dbfe7c50b3d1b79b3
设置并查看oracle角色的DISPLAY
1
2
3
[oracle@glxybd root]$ export DISPLAY=:10.0
[oracle@glxybd root]$ echo $DISPLAY
:10.0

如果配置了图形化界面可跳过直接执行./runInstaller即可成功弹出安装界面,没有配置的话不会弹出界面但也不会报错,可参考下面的图形化界面配置。


配置图形化界面

  1. 先看看是否配置,如果执行xclock报错,command not found
    yum install xorg-x11-apps
  2. 安装X窗口包和字体包
    yum -y groupinstall "X Window System" "Fonts"(安装x窗口相关包,和字体显示包)
  3. 安装xmanager(步骤略…),设置xshell的隧道关联xmanager
    在这里插入图片描述
  4. 关闭当前窗口,重新打开新的窗口进行测试
    xclock会出现时钟界面

执行./runInstaller成功打开窗口,如果未成功打开窗口但也未报错,可能是没配置图形化界面,往下看
在这里插入图片描述

参考文章: Getting “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”? I have the answer :)